simple java program to find length of the string without using inbuilt method